package Test3;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class demo2 {
    public static void main(String[] args) throws Exception {
        Set<String> set = new HashSet<>();
        set.addAll(Arrays.asList("1", "2", "3", "3"));
        System.out.println(set);

        boolean remove1 = set.remove("1");
        System.out.println(remove1);
        System.out.println(set);

        boolean remove2 = set.remove("1");
        System.out.println(remove2);
        System.out.println(set);

        boolean add1 = set.add("5");
        System.out.println(add1);
        System.out.println(set);

        boolean add2 = set.addAll(Set.of("1", "2"));
        System.out.println(add2);
        System.out.println(set);
    }
}
